<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Bienvenido a Sistema de Localizaci&oacute;n Vehicular</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

    <script src="js/jquery.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
			var path = "http://166.78.2.40/mac/actia/back-end/ws_library.php";

            var usuario;
            var password;

            $('#btnEnviar').click(function () {
                usuario = trim($('#txtUsuario').val());
                password = trim($('#txtContrasenia').val());

                if (usuario == "") {
                    alert("Favor de introducir usuario v&aacute;lido");
                } else if (password == "") {
                    alert("Favor de introducir contrase&ntilde;a v&aacute;lida");
                } else {
                    $.ajax({
                        type: "POST",
                        url: path,
                        data: {
                            func: "login",
                            user: usuario,
                            password: password
                        }
                    })

                    .done(function (answer) {
                        var login = JSON.parse(answer);

                        if (login.state == "true") {
                            document.frmInicio.submit();
							
                        } else {
                            alert("Usuario y/o contraseña incorrectos");
                        }


                    });
                }
            });
            /*
             *Funcion para eliminar espacios
             */
            function trim(myString) {
                return myString.replace(/^\s+/g, '').replace(/\s+$/g, '');

            }
        });
    </script>
</head>
<body style="background-image:url('images/BgLogIn.png'); background-repeat:repeat-x;">
    <div id="Main" style="background-image:url('images/FndLogIn.png'); background-repeat: no-repeat; width:1024px; height:768px;">
        <center>
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <table border="0" style="width:494px;height:298px;background-image: url('images/bgGray3.png'); background-repeat: no-repeat;">
                <tr>
                    <td colspan="2">
                        &nbsp;&nbsp;
                        <center>
                            <label ID="lblInstrucion" style="font-family:Verdana, Geneva, sans-serif; font-size:12px ;text-align: justify; color: #306337;"><b>Para acceder: ingrese su usuario y contrase&ntilde;a</b>
                            </label>
                        </center>
                        <br/>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <label id="lblUsuario" style="font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#306337; text-align:right"><b>Usuario:</b>
                        </label>
                    </td>
                    <td>
                        <input type="text" id="txtUsuario" Width="184px" style=" font-family:Verdana, Geneva, sans-serif">
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <label id="lblContraseña" style=" font-family:Verdana, Geneva, sans-serif; font-size:12px;color:#306337"><b>Contrase&ntilde;a:</b>
                            <label>&nbsp;
                    </td>
                    <td>
                        <input id="txtContrasenia" Width="183px" type="password" style=" font-family:Verdana, Geneva, sans-serif"></input>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <label id="lblMensaje" style=" font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#FF0000"><b></b>
                        </label>&nbsp;
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <button id="btnEnviar" class="newStyleBtn" />Acceder</button>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <form name='frmInicio' method='POST' enctype='multipart/form-data' action='Reportes.php' data-ajax='false'></form>
            <br />
            <br />
            <br />
            <br />
        </center>
        <div>
            <center>
                <a href="http://www.actiagroup.com/" target="_blank" style="font-family:Tahoma;font-size:small;color:Black;text-decoration:none;">&copy; 2013 ACTIA Group</a>
                <!--<asp:Label ID="lblDerechosAutor" runat="server" Font-Names="Tahoma" Font-Size="X-Small" ForeColor="Black" Text="&copy; 2012 ACTIA Group"></asp:Label>-->
            </center>
        </div>
    </div>
</body>
</html>
